$(document).ready(function(){
	 					
	/******************************初始化控件*******************************/
     var dataSource = new kendo.data.DataSource({
	  transport: {					
	    read: {
	    	  type: "POST", 
     	      dataType: "jsonp",
     	      url: _basePath+"getReceiptAddressList.do",
     	      data:{}
	    }
	  },
	  schema: {
		   data: "data",
		   total:"total",
		   parse:function(response){
			  for(var i=0;i<response.data.length;i++){
				  response.data[i]["_rowNumber"]=(i+1);							   
			  }
			  return response;
		   }
	  }, 
	  parameterMap : function(options, operation) {
        if (operation == "read") {
          var parameter = {
            page : options.page, //当前页
            pageSize : options.pageSize//每页显示个数
            
          };
          return kendo.stringify(parameter);
        }
      },
	  pageSize: 20,
      serverPaging: true,
      serverFiltering: true,
      serverSorting: true       
	});             
	  
	  /*******************************Grid****Begin**************************************/
	  $("#goodAddListGrid").kendoGrid({
         dataSource:dataSource,
         height: 600,       
         sortable: true,
         pageable:{
			 refresh:true,
			 pageSizes:true,
			 buttonCont:5
		 },   
         resizable: true,
         selectable: "multiple, row",
         columns:[			
			{width: 35,title:  "NO.",field:"_rowNumber"},
            {title: "收货人", field : "name", width : 100},
			{title: "固定电话", field : "telephone", width : 80},	
			{title: "手机", field : "mobile", width : 100},
			{title: "地区", field : "area", width : 150},
			{title: "地址", field : "address", width : 200},
			{title: "默认", field : "isDefault", width : 50,template:function(responseText){
				var isDefault = responseText.isDefault;
				if(isDefault=='0') isDefault="否";
				if(isDefault=='1') isDefault="是";
				else if(isDefault==null) isDefault="";
				return isDefault;
			}}
        ]
     }); 
     /*******************************Grid****End**************************************/
   
	 
});

 